<template>
  <div>
    <!-- 顶部导航栏 -->
    <div class="header">
      <van-sticky>
        <van-nav-bar
          title="订单评论"
          left-text="返回"
          left-arrow
          @click-left="onClickLeft"
        />
      </van-sticky>
    </div>
    <!-- 评论部分 -->
    <van-card
          v-for="item in ordercommit"
          :key="item.id"
        >
          <template #tags>
            <van-tag class="name">
              <span>顾客ID：{{ item.customerId}}</span>
            </van-tag>
            <van-tag class="sta">订单ID：{{ item.orderId }}</van-tag>
            <br />
            <van-tag>{{item.content}}</van-tag>
            <br />
            <van-tag class="time">
              {{ moment(item.commentTime).format("YYYY-MM-DD HH:mm:SS") }}
            </van-tag>
          </template>
        </van-card>
  </div>
</template>

<script>
import { get, post, post_json } from "@/http/axios";
import moment from "moment";
export default {
  data() {
    return {
      ordercommit: {},
    };
  },
  methods: {
      //转换时间格式
    moment,
    // 返回上一个页面
    onClickLeft() {
      this.$router.go(-1);
    },
    //评论
    async comment() {
      let data = {
        page: 1,
        pageSize: 10,
        // orderId:this.orderId
      };
      let res = await get("/orderComment/pageQuery", data);
      // console.log(res);
      this.ordercommit = res.data.data.list;
    },
  },
  created() {
    this.comment();
  },
};
</script>

<style scoped>
.van-card__desc {
  margin-top: 10px;
  font-size: 12px;
}
.van-card {
  box-shadow: 0 0 10px #d5d4529e;
  font-size: 16px;
  border-radius: 15px;
  background-color: #f2c59412;
}
.name span {
  font-size: 18px;
  font-family: times new roman;
}
.van-tag {
  text-align: center;
  border: none;
  background: none;
  color: rgb(104, 89, 89);
  font-size: 15px;
  margin: 5px 10px;
}
.time {
  font-size: 15px;
}
.sta,
.total {
  color: rgb(187, 91, 91);
  float: right;
  margin: 10px 10px;
}
.name_income{
  font-size: 17px;
  margin: 15px 15px;
}
</style>